home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CRecipientIterator.h
-
- Contains: xxx put contents here xxx
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 2/21/95 TMH metrowerks compatiblity changes
- <2> 1/11/95 TMH added IsLast()
- <1> 9/20/94 TMH Abandon RoadsideRest embrace Mercury
- 6/15/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- #ifndef __CRecipientIterator__
- #define __CRecipientIterator__
-
-
- #ifndef __OCE__
- #include "OCE.h"
- #endif
-
- #ifndef __OCEMESSAGING__
- #include "OCEMessaging.h"
- #endif
-
- #ifndef __OCEMAIL__
- #include "OCEMail.h"
- #endif
-
-
- //-----------------------------------------
- // C R e c i p i e n t I t e r a t o r
- //-----------------------------------------
-
-
- #define kMaxRecipSize 256
-
- // OrigRecipient:
- //
- // each entry in the recipient array returned by MSAMGetRecipients is of the below
- // form when getting original recipients.
-
- typedef struct OrigRecipient {
- MailOriginalRecipient ext; // the index is all that is interesting
- OCEPackedRecipient packedRecip;
- } OrigRecipient;
-
-
-
- class CRecipientIterator {
- public:
- CRecipientIterator(MailMsgRef msgRef,MailAttributeID recipientKind);
-
- OrigRecipient* FirstRecipient();
- Boolean More();
- OrigRecipient* NextRecipient();
- virtual void Advance();
- void GetMore();
-
- OrigRecipient* CurrentRecipient() { return fCurrentRecipientPtr; }
-
- Boolean IsLast() { return ( ((fGetIndex+1) == fNumRecipientsReturned) && fPB.more); }
-
- MSAMGetRecipientsPB fPB;
- short fNumRecipientsReturned;
- short fGetIndex;
-
- OrigRecipient* fCurrentRecipientPtr;
- char fRecipientBuffer[kMaxRecipSize];
-
-
- };
-
-
-
- //-------------------------------------------------------------
- // C R e s o l v e d R e c i p i e n t I t e r a t o r
- //------------------------------------------------------------
-
-
-
- // ResolvedRecipient:
- //
- // each entry in the recipient array returned by MSAMGetRecipients is of the below
- // form when getting resolved recipients.
-
- typedef struct ResolvedRecipient {
- MailResolvedRecipient ext;
- OCEPackedRecipient packedRecip;
- } ResolvedRecipient;
-
-
- class CResolvedRecipientIterator : public CRecipientIterator {
- public:
- CResolvedRecipientIterator(MailMsgRef msgRef) : CRecipientIterator(msgRef,kMailResolvedList) {};
-
- ResolvedRecipient* FirstResolvedRecipient() { return (ResolvedRecipient*) CRecipientIterator::FirstRecipient(); }
- ResolvedRecipient* NextResolvedRecipient() { return (ResolvedRecipient*) CRecipientIterator::NextRecipient(); }
- ResolvedRecipient* CurrentResolvedRecipient() { return (ResolvedRecipient*) fCurrentRecipientPtr; }
-
- virtual void Advance();
- };
-
-
- #endif __CRecipientIterator__